<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="Donnees.SpectacleBean"%>
<%
	SpectacleBean[] listeSpectacles = (SpectacleBean[])request.getAttribute("listeSpectacles");
	int noPage = (Integer)request.getAttribute("noPage");
	int nbPages = (Integer)request.getAttribute("nbPages");
%>
<!doctype html>
<html>
	<head>
		<title>Billetterie 525 - Spectacles</title>		
	</head>
			
	<!-- head -->
	<jsp:include page="head.html" />
	
	<body>	
	    <!--container-->
	    <div id="container">
		
		    <!-- header -->
			<jsp:include page="header.html" />
		   
			<!--body-->
			<div class="holder_content">					    
				<h3>LISTE DES SPECTACLES</h3>     
			    <div class="liste">
				    <table >
						<tr>
							<td>Humoriste</td>
				            <td>Nom du spectacle</td>
				        </tr>	       
			            <% for (int i=0; i<listeSpectacles.length;i++){%>	                	
				            <tr onclick="location.href = 'BilletterieServlet?idSpectacle=<%=listeSpectacles[i].getId()%>';">
					        	<td><%=listeSpectacles[i].getArtiste()%></td>
					            <td><%=listeSpectacles[i].getTitre()%></td>
				        	</tr>
			            <%}%>            
					</table>
			    </div>	
			    <div class="pages">
			    	<% for (int i=1; i<=nbPages;i++){%>	                	
				    	<%if(i == noPage){%>
							<a class="currentPage"><%=i%></a>
						<%}else{%>
							<a class="otherPage" href="BilletterieServlet?page=<%=i%>"><%=i%></a>
						<%}%>
			        <%}%>
			    </div>
			    	    
			</div>
		
		<!--end container-->
	    </div>
	   
	   	<!-- footer -->
		<jsp:include page="footer.html" />		
	     
	</body>
</html>